package net.jumpengine.event;

import javafx.scene.input.MouseButton;
import javafx.scene.paint.Color;
import net.jumpengine.Manager;
import net.jumpengine.bean.Base;
import net.jumpengine.bean.TextBase;
import net.jumpengine.inter.IControl;
import net.jumpengine.inter.IMouseEvent;
import net.jumpengine.util.UComm;

public class MouseEvent implements IMouseEvent {
	private IControl focus;

	@Override
	public void click(int x, int y, MouseButton button) {
		Manager.getLog().info("MouseEvent[click]", x," ",y," ",button);
		
		TextBase text;
		for(Base base:Manager.getImageManager().currentSortList()) {
			if(base instanceof TextBase) {
				text=(TextBase) base;
				text.setColor(Color.rgb(UComm.rnd(100, 255), UComm.rnd(100, 255), UComm.rnd(100, 255)));
			}
		}
	}

	@Override
	public void mousePressed(int x, int y, MouseButton button) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseReleased(int x, int y, MouseButton button) {
		// TODO Auto-generated method stub
	}

	@Override
	public void mouseMove(int x, int y, MouseButton button) {
		// TODO Auto-generated method stub
	}

	@Override
	public void setFocus(IControl control) {
		focus=control;
	}

	@Override
	public IControl getFocus() {
		return focus;
	}
}
